// Fill out your copyright notice in the Description page of Project Settings.


#include "Game/AuraGameplayTags.h"

#include "GameplayTagsManager.h"


/**  定义静态成员变量
 *  静态成员: 类内声明,类外定义,通常在.cpp文件定义
 */
FAuraGameplayTags FAuraGameplayTags::AuraGameplayTags;


void FAuraGameplayTags::InitNativeAttributeGameplayTags()
{
	/*
	 * Primary Attributes
	 */
	AuraGameplayTags.Attributes_Primary_Strength = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Primary.Strength"),
			FString("Increases physical damage")
		);

	AuraGameplayTags.Attributes_Primary_Intelligence = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Primary.Intelligence"),
			FString("Increases magical damage")
		);

	AuraGameplayTags.Attributes_Primary_Resilience = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Primary.Resilience"),
			FString("Increases Armor and Armor Penetration")
		);

	AuraGameplayTags.Attributes_Primary_Vigor = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Primary.Vigor"),
			FString("Increases Health")
		);

	/*
	 * Secondary Attributes
	 */
	AuraGameplayTags.Attributes_Secondary_MaxHealth = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.MaxHealth"),
			FString("Maximum amount of Health obtainable")
		);

	AuraGameplayTags.Attributes_Secondary_MaxMana = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.MaxMana"),
			FString("Maximum amount of Mana obtainable")
		);

	AuraGameplayTags.Attributes_Secondary_Armor = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.Armor"),
			FString("Reduces damage taken, improves Block Chance")
		);

	AuraGameplayTags.Attributes_Secondary_ArmorPenetration = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.ArmorPenetration"),
			FString("Ignored Percentage of enemy Armor, increases Critical Hit Chance")
		);

	AuraGameplayTags.Attributes_Secondary_BlockChance = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.BlockChance"),
			FString("Chance to cut incoming damage in half")
		);


	AuraGameplayTags.Attributes_Secondary_CriticalHitChance = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.CriticalHitChance"),
			FString("Chance to double damage plus critical hit bonus")
		);


	AuraGameplayTags.Attributes_Secondary_CriticalHitDamage = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.CriticalHitDamage"),
			FString("Bonus damage added when a critical hit is scored")
		);


	AuraGameplayTags.Attributes_Secondary_CriticalHitResistance = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.CriticalHitResistance"),
			FString("Reduces Critical Hit Chance of attacking Enemies")
		);


	AuraGameplayTags.Attributes_Secondary_HealthRegeneration = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.HealthRegeneration"),
			FString("Amount of Health regenerated every 1 second")
		);


	AuraGameplayTags.Attributes_Secondary_ManaRegeneration = UGameplayTagsManager::Get()
		.AddNativeGameplayTag(
			FName("Attributes.Secondary.ManaRegeneration"),
			FString("Amount of Mana regenerated every 1 second")
		);
}

void FAuraGameplayTags::InitNativeInputGameplayTags()
{
	AuraGameplayTags.InputTag_LMB = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("InputTag.LMB"),
		FString("鼠标左键")
	);

	AuraGameplayTags.InputTag_RMB = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("InputTag.RMB"),
		FString("鼠标右键")
	);

	AuraGameplayTags.InputTag_1 = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("InputTag.1"),
		FString("键盘1键")
	);

	AuraGameplayTags.InputTag_2 = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("InputTag.2"),
		FString("键盘2键")
	);

	AuraGameplayTags.InputTag_3 = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("InputTag.3"),
		FString("键盘3键")
	);

	AuraGameplayTags.InputTag_4 = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("InputTag.4"),
		FString("键盘4键")
	);
}

void FAuraGameplayTags::InitNativeGameplayTags()
{
	InitNativeAttributeGameplayTags();
	InitNativeInputGameplayTags();

	// ----------------------------------------------------------------------------------------------------------------
	//	战斗相关标签
	// ----------------------------------------------------------------------------------------------------------------

	AuraGameplayTags.Effect_HitReact = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Effect.HitReact"),
		FString("受到攻击时被赋予的标签")
	);

	AuraGameplayTags.Abilities_Attack = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Abilities.Attack"),
		FString("技能攻击标签")
	);

		AuraGameplayTags.Abilities_Summon = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Abilities.Fire.FireBolt"),
		FString("火球术技能标签")
	);

	AuraGameplayTags.Abilities_Summon = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Abilities.Summon"),
		FString("召唤技能标签")
	);

	AuraGameplayTags.CombatSocket_Weapon = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("CombatSocket.Weapon"),
		FString("使用武器部位攻击标签")
	);

	AuraGameplayTags.CombatSocket_RightHand = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("CombatSocket.RightHand"),
		FString("右手部位攻击标签")
	);

	AuraGameplayTags.CombatSocket_LeftHand = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("CombatSocket.LeftHand"),
		FString("左手部位攻击标签")
	);
	
	// ----------------------------------------------------------------------------------------------------------------
	//	伤害类标签
	// ----------------------------------------------------------------------------------------------------------------

	AuraGameplayTags.Damage = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Damage"),
		FString("伤害标签")
	);

	AuraGameplayTags.Damage_Fire = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Damage.Fire"),
		FString("火属性伤害")
	);

	AuraGameplayTags.Damage_Arcane = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Damage.Arcane"),
		FString("魔法属性伤害")
	);

	AuraGameplayTags.Damage_Lightning = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Damage.Lightning"),
		FString("雷属性伤害")
	);

	AuraGameplayTags.Damage_Physical = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Damage.Physical"),
		FString("物理属性伤害")
	);

	// ----------------------------------------------------------------------------------------------------------------
	//	抗性类标签
	// ----------------------------------------------------------------------------------------------------------------

	AuraGameplayTags.Attributes_Resistance_Physical = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Attributes.Resistance.Physical"),
		FString("物理抗性")
	);

	AuraGameplayTags.Attributes_Resistance_Fire = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Attributes.Resistance.Fire"),
		FString("火抗性")
	);

	AuraGameplayTags.Attributes_Resistance_Arcane = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Attributes.Resistance.Arcane"),
		FString("魔法抗性")
	);

	AuraGameplayTags.Attributes_Resistance_Lightning = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Attributes.Resistance.Lightning"),
		FString("雷属性抗性")
	);

	// ----------------------------------------------------------------------------------------------------------------
	//	伤害类型及对应抗性注册
	// ----------------------------------------------------------------------------------------------------------------

	AuraGameplayTags.DamageTypesToResistanceMap.Add(
		AuraGameplayTags.Damage_Fire,
		AuraGameplayTags.Attributes_Resistance_Fire
	);

	AuraGameplayTags.DamageTypesToResistanceMap.Add(
		AuraGameplayTags.Damage_Arcane,
		AuraGameplayTags.Attributes_Resistance_Arcane
	);

	AuraGameplayTags.DamageTypesToResistanceMap.Add(
		AuraGameplayTags.Damage_Lightning,
		AuraGameplayTags.Attributes_Resistance_Lightning
	);

	AuraGameplayTags.DamageTypesToResistanceMap.Add(
		AuraGameplayTags.Damage_Physical,
		AuraGameplayTags.Attributes_Resistance_Physical
	);

	AuraGameplayTags.Montage_Attack_1 = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Montage.Attack.1"),
		FString("攻击蒙太奇1的标签")
	);

	AuraGameplayTags.Montage_Attack_2 = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Montage.Attack.2"),
		FString("攻击蒙太奇2的标签")
	);

	AuraGameplayTags.Montage_Attack_3 = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Montage.Attack.3"),
		FString("攻击蒙太奇3的标签")
	);

	AuraGameplayTags.Montage_Attack_4 = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Montage.Attack.4"),
		FString("攻击蒙太奇4的标签")
	);

	// ----------------------------------------------------------------------------------------------------------------
	//	其他标签
	// ----------------------------------------------------------------------------------------------------------------

	AuraGameplayTags.CoolDown_Fire_FireBolt = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("CoolDown.Fire.FireBolt"),
		FString("火球术冷却标签")
	);

	AuraGameplayTags.Attributes_Meta_IncomingXP = UGameplayTagsManager::Get().AddNativeGameplayTag(
		FName("Attributes.Meta.IncomingXP"),
		FString("经验元属性标签")
	);
}

